package com.vv.vv_commonlibrary.utils;

import android.content.Context;
import android.content.res.Resources;
import android.os.Build;

import androidx.annotation.ColorRes;

import com.vv.vv_commonlibrary.R;

public class CompatibleUtils {

    public int getColor(Context context, @ColorRes int colorId) {
        Resources resources = context.getResources();
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            return resources.getColor(colorId, context.getTheme());
        } else {
            return resources.getColor(colorId);
        }
    }
}
